                 
#include "transforms.inc"
                 
#declare w = 60;
#declare h = 60;

#declare dist = 10;
//#declare camp = 10;
//#declare cams = 1;              

#declare NANIM=8;

#declare fn = frame_number;    

#ifdef(StartFrame)
#declare fn = StartFrame;
#end
  
#ifdef(SideView)

 #declare yr=6;
 #declare mfr=0;
 #declare xr = dist * cos( (fn-1+.1)*pi/6 );
 #declare zr = dist * sin( (fn-1+.1)*pi/6 );
 //#declare xr = dist * cos( (4-1+.1)*pi/6 );
 //#declare zr = dist * sin( (4-1+.1)*pi/6 );

#else

 #declare yr=6;
 #declare mfr = mod((fn-1),4);

 #declare xr = dist * cos( (mfr+.1)*pi/2 );
 #declare zr = dist * sin( (mfr+.1)*pi/2 );
 
#end


#declare upsh=0;

#if(mfr=1)
  #declare upsh=.2;
#else #if(mfr=3)
  #declare upsh=.2;
#else #if(mfr=2)
  #declare upsh=.4;
#else #if(mfr=0)
 #declare upsh=.15;
#end #end #end #end


#declare mfd = mod( div((fn-1),4), NANIM );
#declare iswithbomb = (fn > NANIM*4);
//#declare ishalflift = (mfd <= 1 & iswithbomb);
#declare ishalflift = false;


#ifdef(Explode)
  #declare hangle = 480*clock;
  #declare hshake = 4;
#else
 #if( ishalflift )
  #declare hangle = 60;
  #declare hshake = 0;
  #declare ishalflift = true;
 #else
  #if( iswithbomb )
   #declare hangle = 120;
   #declare hshake = 0;
  #else
   #declare hangle = -10;
   #declare hshake = 4;
  #end
 #end
#end


#ifdef( SideView )
 #declare amfd = array[12] { 1, 2, 3, 6, 5, 4, 4, 5, 6, 3, 2, 1 }
 #declare mfd = amfd[ fn-1 ];
#end

#if( mfd = 0 )
  #declare ahh_rot = hangle;                       
  #declare bhh_rot = hangle;
  #declare aul_rot = 0;
  #declare bul_rot = 0;
  #declare al_rot = 0;
  #declare bl_rot = 0;
#else #if( mfd = 1 )
 #if( iswithbomb )
  #declare ahh_rot = hangle;                       
  #declare bhh_rot = hangle;
 #else
  #declare ahh_rot = hangle - 30;                       
  #declare bhh_rot = hangle + 20;
 #end 
  #declare aul_rot = 40;
  #declare bul_rot = 0;
  #declare al_rot = -15;
  #declare bl_rot = -5;
#else #if( mfd = 2 | mfd = 5 )
  #declare ahh_rot = hangle-10*hshake;
  #declare bhh_rot = hangle+6*hshake;

  #declare aul_rot = 40;
  #declare al_rot =  5-40;
  #declare bul_rot = -5;
  #declare bl_rot = -45+5;
#else #if( mfd = 3 | mfd = 6 )
  #declare ahh_rot = hangle-7*hshake;
  #declare bhh_rot = hangle+5*hshake;

  #declare aul_rot = 10;
  #declare al_rot = -10-10;
  #declare bul_rot = 30;
  #declare bl_rot = -30-30;
#else #if( mfd = 4 | mfd = 7 )
  #declare ahh_rot = hangle-4*hshake;                       
  #declare bhh_rot = hangle+3*hshake;

  #declare aul_rot = -10;
  #declare al_rot = -30+10;
  #declare bul_rot = 35;
  #declare bl_rot = -5-35;
#end #end #end #end #end

#declare angm = 1.2;

#if( mfd >= 5 )
  #declare left_hh_rot = bhh_rot;
  #declare right_hh_rot = ahh_rot;
  #declare left_ul_rot = bul_rot *angm;
  #declare left_l_rot = bl_rot *angm;
  #declare right_ul_rot = aul_rot *angm;
  #declare right_l_rot = al_rot *angm;
#else
  #declare left_hh_rot = ahh_rot;
  #declare right_hh_rot = bhh_rot;
  #declare left_ul_rot = aul_rot *angm;
  #declare left_l_rot = al_rot *angm;
  #declare right_ul_rot = bul_rot *angm;
  #declare right_l_rot = bl_rot *angm;
#end



/*            
#declare d = div(fn-1,5);
#if( mod(d,2) )
  #declare cp=1;
#else
  #declare cp=0.2;
#end
*/
#declare cp=0;

camera {
   //perspective
   orthographic
   location <xr, yr, zr>
   right <w/14, 0, 0>
   up <0, h/14, 0>            
   look_at <cp, .2+upsh, 0>     
}     

#macro roundbox(c1, c2, k)
  superellipsoid { <k, k>
    scale (c1-c2)/2
    translate (c1+c2)/2
  }
#end  

#macro roundbox_rot(c1, c2, k, ang, pt)
  superellipsoid { <k, k>
    scale (c1-c2)/2
    translate (c1+c2)/2
    Rotate_Around_Trans(ang, pt)
  }
#end  

#macro roundcyl(p1, p2, r)
union {
  cylinder { p1, p2, r }
  sphere { p1, r }
  sphere { p2, r }
}
#end
  
#macro wire( spl )
union {
  cylinder { spl(.0), spl(.1), .02 }
  cylinder { spl(.1), spl(.2), .02 }
  cylinder { spl(.2), spl(.3), .02 }
  cylinder { spl(.3), spl(.4), .02 }
  cylinder { spl(.4), spl(.5), .02 }
  cylinder { spl(.5), spl(.6), .02 }
  cylinder { spl(.6), spl(.7), .02 }
  cylinder { spl(.7), spl(.8), .02 }
  cylinder { spl(.8), spl(.9), .02 }
  cylinder { spl(.9), spl( 1), .02 }
} 
#end
  
  
                      
#declare finishManG = finish {
    phong 1
    ambient 1 
    specular 0.2
    diffuse 1  
    reflection 0.1
}                     

#declare finishManG2 = finish {
    phong .3
    ambient 1
    specular .1
    diffuse 1
    reflection 0.1
}                     
                      
#declare finishManR = finish {
    phong 1
    ambient 1
    specular 0.8
    diffuse 1
    reflection 0.1
}                     



//                                  
#declare texManR = texture {
  pigment { color rgb <1, 0, 0> }
  finish { finishManR }     
  normal { spherical }
}

#declare texManRa = texture {
  pigment { color rgb <.8, 0, 0> }
  finish { finishManR }     
  normal { spherical }
}

#declare texManR1 = texture {
  //pigment { color rgb <.9, 0, 0> }
  pigment { bozo
    frequency 2
    phase .5
    turbulence 1
    color_map { [0 color <1, 0, 0>] [0.3 color <1, 0, 0>] [.5 color <.8, 0, 0>] [0.7 color <1, 0, 0>] [1 color <1, 0, 0>] }
  }
  finish { finishManR }     
  normal { spherical }
}

#declare texManR2 = texture {
  //pigment { color rgb <.9, 0, 0> }
  pigment { bozo
    frequency 4
    //turbulence 1
    color_map { [0 color <1, 0, 0>] [0.3 color <1, 0, 0>] [.5 color <.6, 0, 0>] [0.7 color <1, 0, 0>] [1 color <1, 0, 0>] }
  }
  finish { finishManR }     
  normal { spherical }
}



#declare texManG = texture {
  pigment { color rgb <0, 1, 0> }
  finish { finishManG }     
  normal { spherical }
}                  

#declare texManG1 = texture {
  //pigment { color rgb <0, 1, 0> }
  pigment { bozo
    frequency 2
    phase .5
    turbulence 1
    color_map { [0 color <0, 1, 0>] [0.3 color <0, 1, 0>] [.5 color <0, .8, 0>] [0.7 color <0, 1, 0>] [1 color <0, 1, 0>] }
  }
  finish { finishManG }     
  normal { spherical }
}                  

#declare texManG1a = texture {
  //pigment { color rgb <0, 1, 0> }
  pigment { bozo
    frequency 2
    phase .5
    turbulence 1
    color_map { [0 color <0, .9, 0>] [0.3 color <0, .9, 0>] [.5 color <0, .7, 0>] [0.7 color <0, .9, 0>] [1 color <0, .9, 0>] }
  }
  finish { finishManG }     
  normal { spherical }
}                  
              
#declare texManG2 = texture {
  pigment { color rgb <0, .6, 0> }
  finish { finishManG2 }     
  normal { spherical }
}                   

#declare texManG3 = texture {
  pigment { color rgb <0, .8, 0> }
  finish { finishManG }     
  normal { spherical }
}                   

#declare texEyeI = texture {
  pigment { color rgb <1, 1, 1> }
  finish { finishManR }     
  normal { spherical }
}                  

#declare texEyeO = texture {
  pigment { color rgb <0, 0, 1/100> }
  finish { finishManR }     
  normal { spherical }
}                  

#declare texBack = texture {
  pigment { color rgb <.5, .5, .5> }
  finish { finishManR }
  normal { spherical }
}

#declare texGlass = texture {
  pigment { color rgbt <1, 1, 1, .5> }
  finish {                 
    //ambient 1.00
    specular 1
    reflection .2
  }
  translate <0.00, -3.25, 0.00>
}              

                 
//background { color rgb <1, 0, 1> }
global_settings { ambient_light color rgb <0.6, 0.6, 0.6> }



// default light
light_source { <+100*xr, 1000, 100*zr> color .5 }      
//light_source { <-100*zr, 500, 100*xr> color .3 }      
//light_source { <0, 500, 1000> color .2 }      
//light_source { <-128, 2500, +3000> color .6 }                       
           




//////////////////////////////////////////////////////////////////////////////
#declare finishBomb = finish {
    //phong 0
    reflection 0
    ambient 1
    diffuse 1  
}               

#declare matBomb = texture {
  pigment { rgb <0, 0, 1> }
  finish { finishBomb }  
}      

#declare RR = .92;
#declare RD = 1.;
#declare RX = 1.2;

#if( ishalflift )
 #declare RD = 0;
 #declare RX = 1.8;
#end

#declare N = 4;

//#declare ang = <N*cos(clock*4*3.14), 0, N*sin(clock*4*3.14)>;

#if( iswithbomb )

sphere { <RX, 1+RD, 0>, RR
  material { texture { matBomb } }
  //Rotate_Around_Trans(ang, <0, 1+RD, 0>)
}

/*
sphere { <RX, 1+RD, 0>, RR
  material { texture { matBomb } }
  Rotate_Around_Trans(ang, <0, 1+RD, 0>)
}

cylinder { <RX, .90+RD, 0> <RX, 1.1+RD, 0> RR
  material { texture { matBomb2 } } 
  Rotate_Around_Trans(ang, <0, 1+RD, 0>)
}         

cylinder { <RX, .9+RR+RD, 0> <RX, 1+RR+RD, 0> RR/2.3
  material { texture { matBomb2 } } 
  Rotate_Around_Trans(ang, <0, 1+RD, 0>)
} 
*/
#end










///////////////////////////////////////////////////////////////////////////////
           
#declare RP = 1.55;
#declare RH = .8;



#declare mouth_ang = 36;

#declare mouth1 = 
  roundbox_rot( <RH*1.08, RP+.2, -.15>, <RH*.8, RP-.14, +.15> .4
                <0, 0, -24> <0, RP, 0> )
                
#declare mouthx =
difference {
  object { mouth1 }
  roundbox_rot( <RH*1.1, RP+.18, -.03-.08>, <RH*.8, RP-.12, +.03-.08> .4
                <0, 0, -24> <0, RP, 0> )
  roundbox_rot( <RH*1.1, RP+.18, -.03+.08>, <RH*.8, RP-.12, +.03+.08> .4
                <0, 0, -24> <0, RP, 0> )
  roundbox_rot( <RH*1.1, RP+.18, -.03>,     <RH*.8, RP-.12, +.03> .4
                <0, 0, -24> <0, RP, 0> )
}

#declare mouth =
union {
  object { mouthx
    Rotate_Around_Trans( <0,mouth_ang,0> <0,RP,0>)
  }
  object { mouthx
    Rotate_Around_Trans( <0,-mouth_ang,0> <0,RP,0>)
  }
}


#declare backcut =
roundbox ( <-.8*RH, RP-.2, .38> < -2, RP-.4, -.38> .4 )
//roundbox ( <-.8*RH, RP+.2, .22> < -2, RP-.4, -.22> .4 )

#declare backplate =
roundbox ( <-.8*RH, RP-.2, .36> < -.81*RH, RP-.4, -.36> .4 )
//roundbox ( <-.8*RH, RP+.2, .22> < -.85*RH, RP-.4, -.22> .4 )

#declare backnuts =
union {
  cylinder { <-.9*RH, RP-.3, 0> <-.8*RH, RP-.3, 0> .04 }
//  cylinder { <-.85*RH, RP+.06, 0> <-.9*RH, RP+.06, 0> .04 }
//  cylinder { <-.85*RH, RP-.1, 0> <-.9*RH, RP-.1, 0> .04 }
//  cylinder { <-.85*RH, RP-.26, 0> <-.9*RH, RP-.26, 0> .04 }
}
                                   

#declare wire1s =
spline {
  cubic_spline
  -.25  <+.9*RH, RP-.3, -.2>
  0     <-.9*RH, RP-.3, -.2>
  //1     <-.8, .8, -.4>
  //1.25  <-.8, .4, -.4>
  1     <-.4, .6, -.65>
  1.25  <-.4, .6, +.1>
}

#declare wire2s =
spline {
  cubic_spline
  -.25  <+.9*RH, RP-.3, -.066>
  0     <-.9*RH, RP-.3, -.066>
//  1     <-.8, .8, -.37>
//  1.25  <-.8, .4, -.37>
  1     <-.4, .56, -.65>
  1.25  <-.4, .56, +.1>
}

#declare wire3s =
spline {
  cubic_spline
  -.25  <+.9*RH, RP-.3, +.066>
  0     <-.9*RH, RP-.3, +.066>
//  1     <-.8, .8, -.34>
//  1.25  <-.8, .4, -.34>
  1     <-.4, .52, -.65>
  1.25  <-.4, .52, +.1>
}

#declare wire4s =
spline {
  cubic_spline
  -.25  <+.9*RH, RP-.3, +.2>
  0     <-.9*RH, RP-.3, +.2>
//  1     <-.8, .8, -.31>
//  1.25  <-.8, .4, -.31>
  1     <-.4, .48, -.65>
  1.25  <-.4, .48, +.1>
}

#declare wire1 = wire(wire1s);
#declare wire2 = wire(wire2s);
#declare wire3 = wire(wire3s);
#declare wire4 = wire(wire4s);

#declare wirehub =
roundbox ( <-.36, .64, -.68> <-.44, .44, -.63> .04 )
                                   
                                   
#declare hd=.1;

#declare helm_cut =
difference {
  //box { <hd, RP+.5, -1> <2, RP-.01, 1> }
  roundbox ( <hd, RP+.5, -1> <2, RP-.01, 1> .6 )
  box { <hd, RP+.5, -1> <-1, RP-2, 1>
    Rotate_Around_Trans(<0, 0, 36>, <hd, RP+.5, 0>)
  }
}  
                  
#declare hk=.05;
                  
#declare helm_cut2a =
difference {
  //box { <hd-hk, RP+.5+hk/2, -1> <2, RP-.01-hk/2, 1> }
  roundbox ( <hd-hk, RP+.5+hk/2, -1> <2, RP-.01-hk/2, 1> .7 )
  box { <hd-hk, RP+.5+hk/2, -1> <-1, RP-2, 1>
    Rotate_Around_Trans(<0, 0, 36>, <hd-hk, RP+.5+hk/2, 0>)
  }
}  
                                           
                                           
#declare helml =
cylinder { <0, RP+RH*.83, 0> <1, RP+RH*.83, 0> .1
  scale <1, 1, 2>
}

#declare helml2 =
cylinder { <0, RP+RH*.83, 0> <.45, RP+RH*.83, 0> .1
scale <1, 1, 2>
}

#declare helml3 =
cylinder { <0, RP+RH*.83, 0> <.46, RP+RH*.83, 0> .08
  scale <1, 1, 2>
}
                 
#declare helmx =                 
difference {
  sphere { <0, RP, 0>, RH }
  helm_cut2a
  backcut
  object { mouth1
    Rotate_Around_Trans( <0,mouth_ang,0> <0,RP,0>)
  }
  object { mouth1
    Rotate_Around_Trans( <0,-mouth_ang,0> <0,RP,0>)
  }
  object { helml }
}

#declare helmx2 =                 
difference {
  intersection {
    sphere { <0, RP, 0>, RH }
    helm_cut2a
  }
  helm_cut
}

#declare eye_rad = RH*0.9;
#declare eye_rado = RH*0.8;
#declare eye_ang = 26*pi/180;
#declare eye_angu = 18*pi/180;
#declare eye_dia = 0.13;

#declare eye_inner =
difference {
  sphere { <0, RP, 0>, eye_rad }
  box { <-.4*RH, RP+1, 1> < -2, RP-1, -1> }
}

#declare eyes = 
union {
  sphere { <eye_rado*cos(eye_ang)*cos(eye_angu), RP+eye_rado*sin(eye_angu), eye_rado*sin(eye_ang)*cos(eye_angu)>, eye_dia }
  sphere { <eye_rado*cos(eye_ang)*cos(eye_angu), RP+eye_rado*sin(eye_angu), -eye_rado*sin(eye_ang)*cos(eye_angu)>, eye_dia }
}

#declare helm2 =
difference {
  cylinder { <0, RP, 0> <0, RP+.1, 0> RH+.02 }
  helm_cut
}


#declare glasses =
intersection {
  sphere { <0, RP, 0> RH }
  helm_cut
}

#declare collar =
cylinder { <0, .6, 0> <0, .8, 0> .4 }              


#declare chestpadx =
roundbox ( <.62, .65, -.4> <.3, .12, +.4> .4 )


#declare body =                    
difference {
  roundbox ( <-.35, .8, -.75> <.6 , -.5, .75> .8 )
  object { chestpadx }
  //roundbox_rot ( <.6, 1, -1> <1 , -1, 1> .7 <0, 0, 20> <.6, .2, 0>)
  roundbox_rot ( <.6, 1, -1> <1 , -1, 1> .7 <0, 0, -10> <.6, 0, 0>)
  roundbox_rot ( <-1, 1, -.7> <1 , -1, -1> .7 <20, 0, 0> <0, .1, -.7>)
  roundbox_rot ( <-1, 1, .7> <1 , -1, 1> .7 <-20, 0, 0>, <0, .1, .7>)
}

#declare belly =                    
difference {
  roundbox ( <-.37, .8, -.77> <.62 , -.5, .77> .8 )
  box { <-.4, 1, -.8> <.65 , 0, .8> }
}

#declare bellyx = roundbox ( <-.37, .8, -.77> <.62 , -.5, .77> .7 );

#declare chestpad =
intersection {
  roundbox ( <-.35, .8, -.75> <.6 , -.5, .75> .8 )
  object { chestpadx }
  translate <.05, 0, 0>
}

#declare chestnuts =
union {
  sphere { <.53, .56, -.27> .06 }
  sphere { <.61, .24, -.27> .06 }
  sphere { <.53, .56, +.27> .06 }
  sphere { <.61, .24, +.27> .06 }
  //sphere { <.56, .58, 0> .05 }
  //sphere { <.64, .24, 0> .05 }
  //sphere { <.56, .58, -.11> .05 }
  //sphere { <.64, .24, -.11> .05 }
  //sphere { <.56, .58, +.11> .05 }
  //sphere { <.64, .24, +.11> .05 }
}


#if( iswithbomb )
#declare SHD = .1;
#declare SHF = .2;
#else
#declare SHD = 0;
#declare SHF = 0;
#end

#declare SHY = .5+SHD;

#declare SHP = .6;
#declare ARP = .8;                      
                      
#declare shoulders =
roundcyl(<.1, SHY, -SHP> <.1, SHY, SHP> .2)

#declare armright =
union {
  roundcyl(<.1, SHY, -SHP> <.1, 0, -ARP> .2)
  roundcyl(<.1, 0, -ARP> <.3+SHF, -.3-SHF, -ARP> .2)
}

#declare armleft =
union {
  roundcyl(<.1, SHY, SHP> <.1, 0, ARP> .2)
  roundcyl(<.1, 0, ARP> <.3+SHF, -.3-SHF, ARP> .2)
}

#include "hand-l.inc"
#include "hand-r.inc"

#declare upleg =
cylinder { <0, 0, 0> <0, .5, 0> .3 }

#declare leg =
roundcyl(<0, 0, 0> <0, .5, 0> .3)

#declare shoe = 
union {
  difference {
    superellipsoid { <.9, .9>
      scale <.45, .3, .35>
      translate <0.25, -1.65, 0>
    }
    box { <-1, -1.75, -1> <1, -2.2, 1> }
  }
  cylinder { <0, -1.75, 0> <0, -1.05, 0> .31 }
}

#declare shoeb =
intersection {
 union {
  difference {
    superellipsoid { <.9, .9>
      scale <.46, .31, .36>
      translate <0.25, -1.65, 0>
    }
    box { <-1, -1.75, -1> <1, -2.2, 1> }
  }
  cylinder { <0, -1.75, 0> <0, -1.05, 0> .33 }
 }
 box { <-1, -1.60, -1> <1, -1.66, 1> }
}


#declare bag =
roundbox(<-.2, .8, -.6> <-.8, -.3, .6> .4)

#declare bag2 =
roundcyl(<-.8, .5, 0> <-.8, 0, 0> .2)

#declare bag3 =
union {
  cylinder { <-.8, .05, 0> <-.8, .2, 0> .23 }
  cylinder { <-.8, .3, 0> <-.8, .45, 0> .23 }
}

             
                       
#declare HEAD = union {

object { helmx
  texture { texManG1 }
}       

object { helmx2
  texture { texManR2 }
}       

//object { glasses
//  texture { texGlass }
//}

difference {
  object { eye_inner }
  object { helml }
  texture { texEyeI }
}

object { helml2
  texture { texManG3 }
}

object { helml3
  texture { texEyeI }
}

object { eyes
  texture { texEyeO }
}

object { mouth
  texture { texManG2 }
}

object { backplate
  texture { texBack }
}

object { backnuts
  texture { texEyeO }
  translate <0, 0, -.2>
}

object { backnuts
  texture { texEyeI }
  translate <0, 0, -.066>
}

object { backnuts
  texture { texManG }
  translate <0, 0, +.066>
}

object { backnuts
  texture { texManR }
  translate <0, 0, +.2>
}

object { wire1
  texture { texEyeO }
}

object { wire2
  texture { texEyeI }
}

object { wire3
  texture { texManG }
}

object { wire4
  texture { texManR }
}

object { wirehub
  texture { texEyeI }
}


object { collar
  texture { texManR }
}            

}


#declare BODY = union {

object { body
  texture { texManG1 }
}

object { chestpad
  texture { texManG1a }
}

object { chestnuts
  texture { texManG2 }
}

object { belly
  texture { texManR1 }
}

object { bag
  texture { texManR2 }
}

union {             
 object { bag2
  texture { texManG }
 }
 object { bag3
  texture { texManG2 }
 }
 translate <0, 0, -.25>
}

union {             
 object { bag2
  texture { texManG }
 }
 object { bag3
  texture { texManG2 }
 }
 translate <0, 0, +.25>
}

object { shoulders
  texture { texManG1 }
}
                       
}



#declare ARMS = union {

object { armleft
  Rotate_Around_Trans(<0, 0, left_hh_rot>, <.1, SHY, SHP>)
  texture { texManG1 }
}  

object { armright
  Rotate_Around_Trans(<0, 0, right_hh_rot>, <.1, SHY, -SHP>)
  texture { texManG1 }
}



object { hand_left
  translate <SHF, -SHF+.1, -.15>
  Rotate_Around_Trans(<0, 0, left_hh_rot>, <.1, SHY, SHP>)
  texture { texManR2 }
}                         
     
object { hand_right
  translate <SHF, -SHF+.1, .15>
  Rotate_Around_Trans(<0, 0, right_hh_rot>, <.1, SHY, -SHP>)
  texture { texManR2 }
}

}



#declare LEGS = union {

object { upleg
  translate <0.05, -.6, -.36>
  Rotate_Around_Trans(<0, 0, right_ul_rot>, <0.05, -.1, -.4>)
  texture { texManR1 }
}

object { leg
  translate <0.05, -1.2, -.36>  
  Rotate_Around_Trans(<0, 0, right_l_rot>, <0.05, -.7, -.4>)
  Rotate_Around_Trans(<0, 0, right_ul_rot>, <0.05, -.1, -.4>)
  texture { texManR1 }
}       

object { shoe
  translate <0.05, 0.2, -.36>
  Rotate_Around_Trans(<0, 0, right_l_rot>, <0.05, -.7, -.4>)
  Rotate_Around_Trans(<0, 0, right_ul_rot>, <0.05, -.1, -.4>)
  texture { texManG1 }
}

object { shoeb
  translate <0.05, 0.2, -.36>
  Rotate_Around_Trans(<0, 0, right_l_rot>, <0.05, -.7, -.4>)
  Rotate_Around_Trans(<0, 0, right_ul_rot>, <0.05, -.1, -.4>)
  texture { texManR }
}

object { upleg
  translate <0.05, -.6, .36>
  Rotate_Around_Trans(<0, 0, left_ul_rot>, <0.05, -.1, .4>)
  texture { texManR1 }
}

object { leg
  translate <0.05, -1.2, .36>  
  Rotate_Around_Trans(<0, 0, left_l_rot>, <0.05, -.7, .4>)
  Rotate_Around_Trans(<0, 0, left_ul_rot>, <0.05, -.1, .4>)
  texture { texManR1 }
}       

object { shoe
  translate <0.05, 0.2, .36>
  Rotate_Around_Trans(<0, 0, left_l_rot>, <0.05, -.7, .4>)
  Rotate_Around_Trans(<0, 0, left_ul_rot>, <0.05, -.1, .4>)
  texture { texManG1 }
}                                         

object { shoeb
  translate <0.05, 0.2, .36>
  Rotate_Around_Trans(<0, 0, left_l_rot>, <0.05, -.7, .4>)
  Rotate_Around_Trans(<0, 0, left_ul_rot>, <0.05, -.1, .4>)
  texture { texManR }
}                                         

}




#ifndef(Explode)

object{HEAD} object{BODY} object{LEGS} object {ARMS}

#else

#declare explode_object = HEAD;

//#declare object_centre = <0, 1.8, 0> ; 
//#declare object_size = < 2, 2, 2> ;       
#declare object_hollow = true ;//false ;     
#declare explode_start = 0;

//#declare exp_location = <0, 1.9, 0> ;            
#declare exp_gravity = 25 ;
#declare exp_spin = 1 ;  
#declare exp_sky = <0, 1, 0> ;
#declare exp_strength = 20 ;
#declare exp_turb = 0.8 ;
#declare exp_falloff = 1 ;        

#declare scale_turb = .8 ;
#declare vel_turb = .8 ;
#declare dir_turb = .1 ;

#declare particle_res = 12 ;    
//#declare particle_texture = texture {pigment {rgb < .1, .05, .0> }}       
#declare ground_plane = true ;
#declare ground_reflection = 0.3 ;
#declare ground_dist = -1.75 ;

//#declare object_orientation = < 45, 45, 0> ; 

#include "Explode.inc"


#declare explode_object = BODY;

//#declare object_centre = <0, 1.8, 0> ; 
//#declare object_size = < 2, 2, 2> ;       
#declare object_hollow = true ;//false ;     
#declare explode_start = 0.15;

//#declare exp_location = <0, 1.9, 0> ;            
#declare exp_gravity = 30 ;
#declare exp_spin = 1 ;  
#declare exp_sky = <0, 1, 0> ;
#declare exp_strength = 5 ;
#declare exp_turb = 0.8 ;
#declare exp_falloff = 1 ;        

#declare scale_turb = .8 ;
#declare vel_turb = .8 ;
#declare dir_turb = .1 ;

#declare particle_res = 10 ;    
//#declare particle_texture = texture {pigment {rgb < .1, .05, .0> }}       
#declare ground_plane = true ;
#declare ground_reflection = 0.3 ;
#declare ground_dist = -1.75 ;

#include "Explode.inc"


#declare explode_object = union { object{LEGS} object{ARMS} };

//#declare object_centre = <0, 1.8, 0> ; 
//#declare object_size = < 2, 2, 2> ;       
#declare object_hollow = true ;//false ;     
#declare explode_start = 0.6;

//#declare exp_location = <0, 1.9, 0> ;            
#declare exp_gravity = 20 ;
#declare exp_spin = 1 ;  
#declare exp_sky = <0, 1, 0> ;
#declare exp_strength = 10 ;
#declare exp_turb = 0.8 ;
#declare exp_falloff = 1 ;        

#declare scale_turb = .8 ;
#declare vel_turb = .8 ;
#declare dir_turb = .1 ;

#declare particle_res = 8 ;    
//#declare particle_texture = texture {pigment {rgb < .1, .05, .0> }}       
#declare ground_plane = true ;
#declare ground_reflection = 0.3 ;
#declare ground_dist = -1.75 ;

#include "Explode.inc"
     
#end //ifndef(Explode)